package main

import (
	"fmt"
	"time"
)

func main() {
	c := make(chan int)

	go func() {
		for i := 0; i < 10; i++ {
			c <- i
			fmt.Println("go")
		}
		close(c)
	}()
	fmt.Println(<-c)
	//for n := range c {
	//	//time.Sleep(time.Second)
	//	fmt.Println(n)
	//}
	time.Sleep(time.Second)
	fmt.Println(<-c)
}
